Skip to content

feat(spec,console): ask_ai action type — focus the in-app assistant on a record - #37215

Merged
os-zhuang merged 15 commits into
mainfrom
claude/project-thread-1nmo7q
Nov 25, 2026
Merged

os-zhuang merged 15 commits into
mainfrom
claude/project-thread-1nmo7q

Conversation

@os-warren

@os-warren os-warren commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Warren · project thread

Fixes #37142
Fixes #37276

维护者速读

What changes

ADR-0160 D7 — an action on one record that focuses the in-app assistant on that record and opens it.

Spec (@objectstack/spec)

  • ActionType gains ask_ai. It is outside the target-required set: it takes no target.
  • ActionSchema and InlineActionSchema refuse a target beside it (inline to too) at the target path, and ai.exposed: true at ai.exposed (false parses). body stays script-only.
  • DashboardHeaderActionSchema refuses actionType: 'ask_ai' at actionType: a header runs on no record. WidgetActionTypeSchema stays derived from ActionType.
  • Reference docs regenerated.

Runtime (@objectstack/runtime)

  • isHeadlessInvokableAction answers false for ask_ai, so MCP list_actions skips it and the AI posture of the action door refuses it, whatever a stored row carries beside the type.
  • headlessActionTypeError answers the REST door with a sentence about the in-app assistant instead of the generic "opens its target".

Console

  • @object-ui/core: ActionRunner gets an ask_ai executor that hands { object, id } to the installed AssistantFocusHandler (setAssistantFocusHandler) and nothing else: no registered handler, no fetch, no success toast unless successMessage is declared. The record is the row a row surface stashed (recordIdField honoured), else the page record, else the one selected row. No record, or several selected, is refused before any confirmText; so is a launch with no handler installed. drawsAction() answers whether an action is drawn; ActionEngine.getActionsForLocation and getBulkActions leave undrawn actions out. isAskAiAction reads type and the legacy actionType.
  • @object-ui/react: <ActionProvider onAskAi> installs the handler (the latest one runs; the gate identity changes only when the handler appears or goes) and useDrawsAction() answers for every surface under it; with no provider, ask_ai is not drawn.
  • @object-ui/app-shell: useAskAiHandler returns dock.open({ agent, fresh: true }) + setChatFocus(focus, { follow: true }) only when the layout hosts the chat drawer (useChatDockControl, which is null when the AI surface is off) and an agent in the catalog advertises capabilities.focus (useAiSurfaceEnabled().focusServed); the console action runtime passes it as onAskAi.
  • No single record ⇒ absent. The bulk bar never offers an ask_ai action (the type of a promoted def is read off its actionDef); ActionRunner.bulkRefusal refuses a per-row run over a selection (the grid's per-record bulk dispatch asks it), and ActionEngine.getBulkActions / executeBulk leave it out. A list header draws it only while exactly one row is selected, and leaves it out (not greyed) with none or several. A related list's toolbar leaves it out, because a launch there runs on the parent; its rows still draw it.
  • The conversation it opens. The click opens the drawer on a fresh thread of an agent that declares capabilities.focus (focusAgentName, an ask agent first), so the drawer's pin control, which asks the active agent, is drawn, and pins the record to that thread. setChatFocus(focus, { follow: true }) (new option): a host showing a conversation keeps that conversation's focus and gives this one to the next conversation it shows; the first send carries it onto the id it mints, and an unsent fresh thread creates nothing.
  • resolveAiApiBase moves to hooks/aiApiBase.ts (re-exported from useAiSurface), so useAskAiHandler does not import a module many layout tests mock.
  • Every action surface asks useDrawsAction() beside its existing gates: record header/DeclaredActionsBar, action:bar, action:button, action:icon, action:group, action:menu, element buttons, container action filters, grid row menu and actions column, data-table row actions, related-list toolbar, bulk action bar.

Tests

  • packages/spec/src/ui/action-ask-ai.test.ts: member, parses with no target, refusals at target / ai.exposed (both in one parse), ai.exposed: false accepted, body refused, inline refusals, neighbours keep their rules.
  • packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts: header refusal, vocabulary still derived, other types still accepted.
  • packages/runtime/src/action-ask-ai-headless.test.ts: not headless-invokable (with or without automation, and for an at-rest row carrying target/body/ai.exposed), REST sentence.
  • ui/packages/core/src/actions/__tests__/ActionRunner.askAi-37142.test.ts: click hands the record once and sends nothing (fetch stub, script handler, toast unspied), row / scoped / selected record readings, refusals before confirm, not drawn without a handler, ActionEngine filtering.
  • ui/packages/react/src/context/__tests__/ActionProvider.askAi-37142.test.tsx: drawn only with onAskAi, gate identity, latest handler runs, no provider.
  • ui/packages/app-shell/src/hooks/__tests__/useAskAiHandler-37142.test.tsx, useAiSurface.test.ts (focusServed), views/__tests__/DeclaredActionsBar.askAi-37142.test.tsx (absent without assistant, drawn and focuses with one; ablation of the filter turns it red).
  • skills/objectstack-ui/SKILL.md: one table row and one sentence (164 → 165 lines); the token ratchet stays under its ceiling.
  • ui/packages/core/src/actions/__tests__/ActionRunner.askAi-37142.test.ts adds bulkRefusal, getBulkActions / executeBulk and page-record recordIdField; plugin-grid/src/__tests__/BulkActionBar.askAi-37142.test.tsx, plugin-detail/src/__tests__/RelatedList.toolbarAskAi-37142.test.tsx, app-shell/src/views/__tests__/objectViewHeaderLaunchGate.askAi-37142.test.tsx pin the three no-single-record surfaces; useAskAiHandler-37142 pins the agent it opens.
  • ui/packages/app-shell/src/layout/__tests__/chatFocus-36999.test.tsx (objectstack#37142 block): the real dock body and focus host under a real useAskAiHandler; a drawer open on another conversation keeps that conversation's focus and the fresh thread's first send carries the record; a drawer on an unsent thread takes it at once. Ablated: without follow, and with open({ agent }) instead of the fresh thread, the first case fails.
  • The same block pins N4: after an ask_ai click, opening a history conversation before sending shows and sends that conversation's own focus (rec_9 kept), and a conversation with no focus gets none. Ablated: without the target key, both fail.
  • Updated pins that enumerate ActionType.options (spec row-update, undoable, inline; Studio presets and type-switch pins).

Acceptance notes

  • Contract review N4 (an unsent fresh thread's carry lands on a history conversation picked before the first send; predates this PR, widened by it): filed as 37142 跟进:「问 AI」新对话未发送时切到历史对话,会把记录焦点带到那个旧对话上 #37276 (claim 7160324153) and fixed here. useConversationFocus takes a key of the dock's target and drops a hand-off's carry when it changes, so only the id the target resolves, or the first send mints, takes the carried focus. A pending follow is kept across that change.
  • Studio's action inspector does not offer ask_ai in its Type picker (its option list is hand-written); authoring is code / metadata only for now.
  • params beside ask_ai are not refused (inert); a record-less location such as list_toolbar is not refused at parse — the action is absent there unless exactly one row is selected, and the runner refuses a launch that reaches it anyway.
  • The global ConsoleShell action runtime sits above the chat dock, so ask_ai is absent there; per-view runtimes inside the layout get it. Direct useActionRunner owners get no handler, so ask_ai is absent for them.
  • form.tsx (update-operation actions only) and the managed-by empty state are not gated.
  • The dashboard-header refusal goes beyond the ADR's words; flagged for L2 (judged justified in record 7152689299).
  • The SKILL.md row does not name the dashboard-header refusal (R7): adding it puts the file 14 tokens over its ratchet ceiling, so it is left to 37142 跟进:AI 技能文档教作者放「问 AI」按钮(ask_ai 动作) #37217.

Verification

  • @objectstack/spec: full suite 892 files / 28329 tests pass.
  • @objectstack/runtime: typecheck pass; ask_ai + declarative-update tests pass.
  • @object-ui/core 4789, @object-ui/react 1601, @object-ui/components 4966, @object-ui/plugin-grid 2783, @object-ui/plugin-detail 3941 tests pass; type-check passes on all six ui packages.
  • @object-ui/app-shell: hooks, console, metadata-admin, studio-design and DeclaredActionsBar tests pass (1204 files after the two pin fixes).
  • Review round (R1–R6) and the three CI failures at 076ed686: @object-ui/core 248 files / 4792 pass; plugin-grid __tests__ + components 272 files pass; plugin-detail RelatedList / RecordRelatedListRenderer 73 files pass; app-shell layout + hooks + console/home 311 files pass, views 220 files pass; @objectstack/example-showcase 49 files / 554 pass; type-check passes on core, plugin-grid, plugin-detail, app-shell. New tests each turn red when their fix is removed (list header 3/3, bulk bar 1/1, related-list toolbar 1/1, and the two CI-red AppHeader files fail again with the old import).
  • Gates derived by scripts/pm/dispatch-gates.mjs --commands for this change set (131 commands): all pass except three that could not measure in this container — check-plugin-teardown-shape --self-test (needs an unshallow clone), check:dual-build-cjs-loads (needs every package's dist/); check:skill-examples passed on a re-run once the spec build had finished. CI runs them in full.
  • ESLint on every changed source and test file: 0 errors.

Clause-②: yes
Metadata-protocol: added
Skills-docs: follow-up #37217

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

…n a record

ADR-0160 D7. The spec member and the console executor in one change:
ActionType gains ask_ai (no target, refused at parse beside a target or
ai.exposed: true); the runtime keeps it out of every headless door; the
console executor pins the record through setChatFocus and opens the
drawer, and the action is absent where the console has no assistant
that honours a focus.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
…ard headers

Gate action:button, action:icon, action:group and action:menu members with
useDrawsAction, refuse `actionType: 'ask_ai'` on a dashboard header (it runs
on no record), carry `focusServed` in the AI surface fixtures, and teach the
two Studio pin tests that `ask_ai` takes no target. Changeset for #37142.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
skills/objectstack-ui/SKILL.md's Action Types table is registered exhaustive
over ActionType (check:skill-identifier-liveness), so it gains the ask_ai row
and the "requires target" sentence names its second exception. Three edited
test files take module-top side-effect imports so the dependency load is
paid during collection (check:test-source-alias).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
@os-warren os-warren self-assigned this Nov 25, 2026
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:ui tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/runtime, @objectstack/spec, touching 13 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/spec/src/ui/component.zod.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/flows.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/deployment/troubleshooting.mdx (via ActionSchema (symbol, a top-level const))
  • content/docs/deployment/validating-metadata.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/frontend/architecture-overview.mdx (via ActionSchema (symbol, a top-level const))
  • content/docs/frontend/layout.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/frontend/quick-start.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/frontend/schema-rendering.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/frontend/troubleshooting.mdx (via ActionSchema (symbol, a top-level const))
  • content/docs/getting-started/build-with-claude-code.mdx (via record_header (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/getting-started/quick-reference.mdx (via ActionType (symbol, a top-level const object))
  • content/docs/protocol/objectui/actions.mdx (via ActionSchema (symbol, a top-level const), ask_ai (literal, a string literal in ActionType; a string literal in TARGETLESS_TYPES; a string literal in headlessActionTypeError; a string literal in refuseAskAiContradictions; a string literal in refuseRecordlessAskAi), record_header (literal, a string literal in refuseRecordlessAskAi), record_more (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/protocol/objectui/layout-dsl.mdx (via record_header (literal, a string literal in refuseRecordlessAskAi), record_more (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/ui/actions.mdx (via ask_ai (literal, a string literal in ActionType; a string literal in TARGETLESS_TYPES; a string literal in headlessActionTypeError; a string literal in refuseAskAiContradictions; a string literal in refuseRecordlessAskAi), record_header (literal, a string literal in refuseRecordlessAskAi), record_more (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/ui/create-vs-edit-form.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/ui/pages.mdx (via record_header (literal, a string literal in refuseRecordlessAskAi), record_more (literal, a string literal in refuseRecordlessAskAi))

⛔ 11 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v15.mdx (via record_more (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/releases/v16.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/releases/v17/17-0.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/releases/v17/17-1.mdx (via ActionSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-3.mdx (via ActionSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-6.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/releases/v17/17-7.mdx (via actionType (literal, a string literal in refuseRecordlessAskAi))
  • content/docs/releases/v17/index.mdx (via ActionSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-2.mdx (via ActionSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-3.mdx (via ActionSchema (symbol, a top-level const), InlineActionSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-4.mdx (via ActionSchema (symbol, a top-level const), InlineActionSchema (symbol, a top-level const), record_header (literal, a string literal in refuseRecordlessAskAi), record_more (literal, a string literal in refuseRecordlessAskAi))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/src/ui/component.zod.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 181 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json f9fda2a4f84f2b49a7c14f1a994788ee76f13c73 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from f51c93b5ca1a7aa179ea3d43203b7b87234aa63e — the merge of head 8c569968e24d85be4bcf7d819effe3d4db4ebdf2 into base f9fda2a4f84f2b49a7c14f1a994788ee76f13c73, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin f51c93b5ca1a7aa179ea3d43203b7b87234aa63e && git checkout f51c93b5ca1a7aa179ea3d43203b7b87234aa63e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f9fda2a4f84f2b49a7c14f1a994788ee76f13c73 8c569968e24d85be4bcf7d819effe3d4db4ebdf2 && git checkout -B drift-repro f9fda2a4f84f2b49a7c14f1a994788ee76f13c73 && git merge --no-ff 8c569968e24d85be4bcf7d819effe3d4db4ebdf2

node scripts/docs-audit/affected-docs.mjs --json f9fda2a4f84f2b49a7c14f1a994788ee76f13c73

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs f9fda2a4f84f2b49a7c14f1a994788ee76f13c73 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract-review-claim: session_01JQwxbZeHNsF3RWcWpj7rGj · head 076ed68 · 2026-11-25T04:10Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 076ed68671c72dfd944d9b365b4d4f6c3b1fd590
Local-runs: none
Scope: packages/spec/src/ui/action.zod.ts, packages/spec/src/ui/component.zod.ts, packages/spec/src/ui/dashboard.zod.ts, skills/objectstack-ui/SKILL.md + packages/runtime/src/action-execution.ts, ui/packages/core/src/actions/ActionRunner.ts, ui/packages/core/src/actions/ActionEngine.ts, ui/packages/react/src/context/ActionContext.tsx, ui/packages/app-shell/src/hooks/{useAskAiHandler,useAiSurface,surfaceAgent}.ts, ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx, ui/packages/app-shell/src/views/DeclaredActionsBar.tsx, ui/packages/app-shell/src/console/ConsoleShell.tsx, the twelve renderer files under ui/packages/components, plugin-grid and plugin-detail, .changeset/37142-ask-ai-action-type.md; read as context, not in the diff: objectViewHeaderLaunchGate.tsx, RelatedRecordActionsBridge.tsx, ObjectGrid.tsx bulk dispatch, resolveBulkActions.ts, chatFocus.ts, AiChatPage.tsx, pr-automation.yml level rule
Security-touching: yes
Rule-change-verified: none

① Derived judgments

  • Spec member: met. ask_ai is outside TARGET_REQUIRED_TYPES, through the new TARGETLESS_TYPES. refuseAskAiContradictions refuses target at target, and ai.exposed: true at ai.exposed, on both ActionSchema and InlineActionSchema. The member and its executor land in one PR.
  • Headless: met. isHeadlessInvokableAction falls through to false for ask_ai, so list_actions, run_action and the action_ family do not serve it.
  • No message, no server call: met. executeAskAi only calls the installed handler, which is setChatFocus plus dock.open(). Nothing posts to the chat endpoint or starts a flow.
  • Absent without the assistant: met. Every surface that reads isActionSwitchedOff also reads the draw gate, except form.tsx and managedByEmptyState.ts, which the PR names. With no handler, the action is not drawn, rather than drawn disabled.
  • "No single record ⇒ absent": not met. See R1 and R2.
  • Dashboard header refusal: justified. A header has no record and no selection, so every click would be refused. It follows the refuseUnopenableHeaderActionUrl precedent, and it narrows nothing, because on main the enum already rejected ask_ai.
  • SQL push-down: n/a.

② Semver level

  • Clause-②: yes (widening) and Metadata-protocol: added are correct.
  • spec, core, react and app-shell are minor; runtime, components, plugin-grid and plugin-detail are patch. The patch packages gain no export and no authorable key.
  • Check Changeset is green.

③ Boundary flags

  • Security. The focus { object, id } comes from a row, page record or selection the client already holds. It is advisory: per ADR-0160 D6, the server re-reads the record as the caller. No path widens what a user can read.
  • MCP. No headless surface serves the action, and ai.exposed: true is refused at parse.
  • Generated artifacts. Only content/docs/references/** moves. The regeneration gates are still running.
  • SKILL.md. One row added (+138 bytes). The token ratchet is not finished.
  • CI. 66 check-runs: 19 success, 9 skipped, 38 in progress, 0 failed. The verdict rests on R1 and R2, not on CI.

④ Design judgment

The spec half and the absent-not-disabled draw gate are sound and well tested. The gap is on the three surfaces that hold no single record. There the action is drawn, and then it is disabled, behaves wrongly without saying so, or points at the parent record.

Findings

  • R1 (must-fix): multi-select pins a record instead of being absent. ui/packages/plugin-grid/src/components/BulkActionBar.tsx:111-115, ui/packages/core/src/actions/ActionRunner.ts:3051-3068.
    • A list view's bulkActions may name an ask_ai action. The per-record bulk dispatcher runs it once per selected row, with _rowRecord set.
    • askAiFocus reads that row, so the "several selected" refusal is never reached. The handler fires N times, the last row stays pinned, and the result panel counts N successes.
    • Fix: leave ask_ai out of the bulk item set, refuse a bulk dispatch in the runner, and add a test.
  • R2 (must-fix): list_toolbar draws it disabled, not absent. ActionRunner.ts:2044-2051, via objectViewHeaderLaunchGate.tsx:47-57. With zero or several rows selected, the list header shows the button greyed out with a reason. The card's acceptance says absent, and the maintainer's note of 2026-11-25 added that line. Make it absent wherever no single record is held.
  • R3 (should-fix): the draw gate is wider than the pin control's. surfaceAgent.ts:100-102, useAskAiHandler.ts:38. The gate holds when any catalog agent has capabilities.focus, but the pin control (AiChatPage.tsx:2070) asks the active agent. D7 draws the action "only under the condition it draws the pin control".
  • R4 (should-fix): a related-list toolbar ask_ai focuses the parent record. RelatedRecordActionsBridge.tsx:713-716. This is another surface with no single record, as in R2.
  • R5 (should-fix): Skills-docs line form. It now reads follow-up owed — …. The card is filed as 37142 跟进:AI 技能文档教作者放「问 AI」按钮(ask_ai 动作) #37217, so the line should read Skills-docs: follow-up #37217 in the PR body and in the changeset.
  • R6 (nit). recordIdField is honoured on the row and selected-row paths but not the page-record path (ActionRunner.ts:3058-3066).
  • R7 (nit). The SKILL.md row (:151) omits the dashboard-header refusal. Optional.

Implemented-by: session_01JQwxbZNHwt6dj15KeoAPMP
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: FAIL

Review round on #37215. The bulk bar never offers an ask_ai action (its type
is on a promoted def's actionDef), ActionRunner.bulkRefusal refuses a per-row
run over a selection, and ActionEngine.getBulkActions / executeBulk leave it
out. A list header draws it only while exactly one row is selected, rather
than greyed out with a reason. A related list's toolbar leaves it out (its
rows still draw it). The click opens the drawer on an agent that declares
capabilities.focus, so the drawer's pin control is drawn on the record. The
page-record path reads recordIdField too.

resolveAiApiBase moves to its own module so useAskAiHandler does not import
useAiSurface, which layout tests replace with a mock. The showcase app gains
an ask_ai action, as its coverage test requires every ActionType.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
…write

The list header ask_ai test assigned a module variable inside a component,
which the React compiler lint refuses (Lint UI, app-shell).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 159f98ccad82bdd78a29192d98776670634c57ec
Local-runs: none
Scope: delta from 076ed68, the PR's own commits f003d0e, c0f9417, 15af54a, 6740772, 7a6b50d, 159f98c; plus the PR face of the first review's Scope files across merges 15513b8 and 5671abd; read as context: ui/packages/app-shell/src/layout/chatFocus.ts
Security-touching: yes
Rule-change-verified: none

2026-11-25T09:58Z — delta read after the FAIL at 076ed686. All six earlier findings are met, but the R3 fix introduces one new must-fix (N1).

Prior findings

  • R1 — met. BulkActionBar.tsx:117-118 leaves ask_ai out of the bulk set. ObjectGrid.tsx:2933-2934 refuses it through the new ActionRunner.bulkRefusal. ActionEngine.ts:317 and :367-369 exclude it as well. Covered by BulkActionBar.askAi-37142.test.tsx.
  • R2 — met. objectViewHeaderLaunchGate.tsx:55-58 draws the button only when exactly one row is selected. Covered by its test.
  • R3 — met as asked. The handler opens the drawer on a capabilities.focus agent, with ask first (surfaceAgent.ts:111-114, useAskAiHandler.ts:46-47). See N1.
  • R4 — met. RelatedList.tsx:1587 filters ask_ai out of the toolbar. record-related-list.tsx feeds the same prop, so it is covered too. Covered by RelatedList.toolbarAskAi-37142.test.tsx.
  • R5 — met. The PR body and the changeset both read Skills-docs: follow-up #37217.
  • R6 — met. The page-record path in askAiFocus now reads recordIdField.
  • R7 — deferred to 37142 跟进:AI 技能文档教作者放「问 AI」按钮(ask_ai 动作) #37217. Accepted: it was a nit.

Merge sanity

Across both merges, the PR face of the first review's Scope files is unchanged: 19 files, +248 −35. The added and removed lines hash the same at 076ed686 and 159f98cc.

Findings in the delta

  • N1 (must-fix): with the drawer open on another conversation, the click pins the conversation being left. useAskAiHandler.ts:46-47.
    • The handler calls setChatFocus and then open({ agent }).
    • When the mounted host already shows a conversation id, handOff (chatFocus.ts:242) sets no carry. The focus is therefore written to the conversation on screen.
    • open({ agent }) then moves the drawer to the agent's own conversation. useConversationFocus (chatFocus.ts:190-200) reads that conversation's stored focus, which is empty.
    • The result: no chip, no focus on the turn, and a stray pin left on the conversation the user moved away from.
    • This happens whenever the open drawer shows something other than the target agent's conversation, for example the app-bound build thread.
    • The fix order is to switch the agent first and then hand off, or to hand the focus to open itself. Add a test with a mounted host on another conversation; the current test mocks both sides, so it cannot see this.
  • N2 (nit). The Skills-docs line dropped "updated here", but skills/objectstack-ui/SKILL.md still changes in this PR.
  • N3 (nit). bulkRefusal refuses on type alone, ignoring a host-registered ask_ai handler. refusalBeforeInput steps aside for one. No effect today, because the console registers none.
  • No finding: the showcase action showcase_ask_about_task (record_header, no target, no ai block), the ActionEngine narrowing, and the two action-type tables.

Declarations and CI

Clause-②: yes, Metadata-protocol: added and the changeset levels are unchanged and still correct. CI on 159f98cc: 61 success, 9 skipped, 0 failed, 0 pending.

Implemented-by: session_01JQwxbZNHwt6dj15KeoAPMP
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: FAIL

…, not the one on screen

With the drawer already open on another conversation, the click pinned the
record to that conversation and then switched away from it: the thread the
drawer moved to had no focus, and the one left behind kept a stray pin.

The handler now opens a fresh thread of the focus-honouring agent first and
pins the record with `setChatFocus(focus, { follow: true })`: a host showing
a conversation keeps that conversation's focus and gives this one to the next
conversation it shows (carried onto the id the first send mints). Pinned
against the real dock body and focus host, with both halves ablated.

bulkRefusal's docblock now says why it reads the type alone.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 76f9cdab6ad3334c1e5438da6740969d1f202845
Local-runs: none
Scope: delta from 159f98c, commit 76f9cda: ui/packages/app-shell/src/hooks/useAskAiHandler.ts, ui/packages/app-shell/src/layout/chatFocus.ts, ui/packages/core/src/actions/ActionRunner.ts, .changeset/37142-ask-ai-action-type.md, content/docs/protocol/objectui/actions.mdx, two test files; read as context: ChatDockConversation.tsx, useChatConversation.ts (forceNew), chatDockTarget.ts, .claude/skills/pm-dispatch/SKILL.md:321
Security-touching: yes
Rule-change-verified: none

2026-11-25T10:42Z — second delta read, after FAIL 7159069237 at 159f98cc. N1 is fixed. The spec face is unchanged, so R1–R6 still hold as met.

① Derived judgments

  • N1 — fixed. The handler now calls open({ agent, fresh: true }) and then setChatFocus(focus, { follow: true }) (useAskAiHandler.ts:49-50).
    • Drawer open on another conversation (the app-bound build thread included) or on the target's own thread: fresh sets forceNew (useChatConversation.ts:1072-1075), which blanks the id. The key always moves from the old id to undefined, and the follow lands there with carry. The conversation the user left keeps its own focus.
    • Unsent thread or closed drawer: the focus is taken at once, or held as pending for the host that mounts.
    • The new block in chatFocus-36999.test.tsx runs against the real ChatDockConversation, useConversationFocus and useAskAiHandler.
  • follow does not leak. A pending follow lives in the dock host's state and unmounts with the drawer. It could only hang if the key stayed unchanged, and fresh always changes a defined key. setFocus and decline on the chip drop it.
  • Fresh thread vs ADR-0160 D7: not contradicted, since nothing is created until the first send. It does go past D7's "same path as the pin control": every click now opens a new conversation. That is reversible console behaviour with no schema impact, and it goes to the maintainer as a product question. It does not hold the verdict.

② Semver level

Unchanged and correct: Clause-②: yes, Metadata-protocol: added. spec, core, react and app-shell are minor (the new setChatFocus option is in app-shell); the rest are patch.

③ Boundary flags

  • Security: the focus is still the record the click ran on, reported by the client and re-read as the caller. The change only decides which conversation holds it.
  • CI on 76f9cdab: 62 success, 11 skipped, 0 failed. One PR-body guards run was cancelled; it had been superseded by a later run, which passed.

Findings

  • N4 (should-fix, non-blocking; follow-up card): until the fresh thread gets an id, it holds the record with carry (chatFocus.ts:215-230). If the user picks a history conversation instead of sending, that conversation takes the record and its stored focus is overwritten. The carry rule predates this PR; the fresh thread only widens the window. The chip stays visible and removable.
  • N2 — withdrawn. Skills-docs: follow-up #37217 is the right form: updated here is reserved for domain:skills PRs (pm-dispatch SKILL.md:321).
  • N3 — accepted. The type-only bulk refusal is documented at ActionRunner.ts:2041-2043.

Implemented-by: session_01JQwxbZNHwt6dj15KeoAPMP
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

这个 PR 让应用作者可以给记录配一个「问 AI」按钮。点下去,助手面板会打开,并带上这条记录作为话题,但不会替用户发出任何消息。如果当前没有支持记录话题的助手,按钮就不显示。按钮只出现在「恰好一条记录」的位置:选了多行、列表表头没选中、关联列表工具栏这些地方都不显示。合同评审(fable 档)做了三轮,最后一轮通过。
要你做的:这个 PR 改了受管文件(平台界面技能),需要你在 head 76f9cdab 上点批准或亲自入队。另外有一个产品取舍要你定:现在每次点「问 AI」都会新开一个对话。我会另外单独问你。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head 76f9cdab · 2026-11-25T10:43Z

…dock's target resolves

After an ask_ai click the fresh thread holds the record with carry until an
id arrives. A history conversation (or another app's thread) opened before
the first send took that carry, and its own stored focus was overwritten.

useConversationFocus takes a key of what the host was asked to show; the dock
passes its target. A change of target drops the hand-off's carry, so only the
id the target resolves, or the first send mints, takes the carried focus. A
pending `follow` survives the change, since the caller that moved the target
set it for that move. Pinned against the real dock; ablated without the key.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 8c569968e24d85be4bcf7d819effe3d4db4ebdf2
Local-runs: none
Scope: delta from 76f9cda, commit 8c56996: ui/packages/app-shell/src/layout/chatFocus.ts, ui/packages/app-shell/src/layout/ChatDockConversation.tsx, ui/packages/app-shell/src/layout/tests/chatFocus-36999.test.tsx, .changeset/37142-ask-ai-action-type.md; read as context: ui/packages/app-shell/src/layout/useConsoleChatDock.tsx, ui/packages/app-shell/src/console/ai/AiChatPage.tsx
Security-touching: yes
Rule-change-verified: none

2026-11-25T11:25Z — third delta read, after PASS 7160086862 at 76f9cdab, which named N4 open. The spec face is unchanged; R1–R6 and N1 remain met.

① Derived judgments

  • History pick before the first send. A change of the dock's target now drops the hand-off's carry (chatFocus.ts:232). The arriving id reads that conversation's own stored focus. This holds whether the record arrived at once or through a follow.
  • App move before the first send. The target is passed only while the dock follows the app (useConsoleChatDock.tsx:109). Moving apps changes the key, and the carry drops before the other app's thread resolves.
  • The first send still carries. The record stays as the unsent thread's entry, and the send moves it onto the minted id through sendingRef, which is untouched.
  • follow surviving a target change does not reopen N1. The follow resolves on the same event's renders, so there is no window for a history pick. With two quick clicks, the later record replaces the earlier one. setFocus, decline and a plain hand-off clear a pending follow.
  • Pin-then-open still carries. dock.open() with no target leaves the key unchanged. AiChatPage.tsx:1255 passes no target, so its behaviour is unchanged.

② Semver level

Unchanged and correct: Clause-②: yes, Metadata-protocol: added. spec, core, react and app-shell are minor; the rest are patch. The new optional parameter is in app-shell.

③ Boundary flags

  • Security: no change. The focus is the record clicked, client-reported and re-read as the caller.
  • PR body: Fixes #37276 (the N4 card) sits beside Fixes #37142.
  • CI on 8c569968: 62 success, 11 skipped. The failed PR-body guards run at 10:52Z was superseded by a passing rerun at 10:54Z.

Findings

  • N4 (should-fix): closed. A history conversation picked, or an app moved to, before the first send no longer takes the record. The carry drops on a target change (chatFocus.ts:232, with the target passed at ChatDockConversation.tsx:319-320). Two tests cover the history pick, one with a stored focus and one without.
  • Product question (not a defect): whether "ask AI" should always start a new conversation is with the maintainer. This commit does not change it.

No must-fix, no should-fix open.

Implemented-by: session_01JQwxbZNHwt6dj15KeoAPMP
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

这个 PR 让应用作者可以给记录配一个「问 AI」按钮。点下去,助手面板会打开,并带上这条记录作为话题,但不会替用户发出任何消息。如果当前没有支持记录话题的助手,按钮就不显示。按钮只出现在「恰好一条记录」的位置:选了多行、列表表头没选中、关联列表工具栏这些地方都不显示。合同评审(fable 档)做了三轮,最后一轮通过。
要你做的:这个 PR 改了受管文件(平台界面技能),需要你在 head 8c569968 上点批准或亲自入队。另外有一个产品取舍要你定:现在每次点「问 AI」都会新开一个对话。我会另外单独问你。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head 8c569968 · 2026-11-25T11:25Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 8c569968e24d85be4bcf7d819effe3d4db4ebdf2
Local-runs: none
Scope: delta from 76f9cda, commit 8c56996: ui/packages/app-shell/src/layout/chatFocus.ts, ui/packages/app-shell/src/layout/ChatDockConversation.tsx, ui/packages/app-shell/src/layout/tests/chatFocus-36999.test.tsx, .changeset/37142-ask-ai-action-type.md; read as context: ui/packages/app-shell/src/layout/useConsoleChatDock.tsx, ui/packages/app-shell/src/console/ai/AiChatPage.tsx
Security-touching: yes
Rule-change-verified: none

2026-11-25T11:27Z — third delta read, after PASS 7160086862 at 76f9cdab, which left N4 open. This re-issues record 7161028670 at the same head with the N4 line reshaped for the guard; the review is unchanged. The spec face is unchanged; R1–R6 and N1 remain met.

① Derived judgments

  • History pick before the first send. A change of the dock's target now drops the hand-off's carry (chatFocus.ts:232). The arriving id reads that conversation's own stored focus. This holds whether the record arrived at once or through a follow.
  • App move before the first send. The target is passed only while the dock follows the app (useConsoleChatDock.tsx:109). Moving apps changes the key, and the carry drops before the other app's thread resolves.
  • The first send still carries. The record stays as the unsent thread's entry, and the send moves it onto the minted id through sendingRef, which is untouched.
  • follow surviving a target change does not reopen N1. The follow resolves on the same event's renders, so there is no window for a history pick. With two quick clicks, the later record replaces the earlier one. setFocus, decline and a plain hand-off clear a pending follow.
  • Pin-then-open still carries. dock.open() with no target leaves the key unchanged. AiChatPage.tsx:1255 passes no target, so its behaviour is unchanged.

② Semver level

Unchanged and correct: Clause-②: yes, Metadata-protocol: added. spec, core, react and app-shell are minor; the rest are patch. The new optional parameter is in app-shell.

③ Boundary flags

  • Security: no change. The focus is the record clicked, client-reported and re-read as the caller.
  • PR body: Fixes #37276 (the N4 card) sits beside Fixes #37142.
  • CI on 8c569968: 62 success, 11 skipped. The failed PR-body guards run at 10:52Z was superseded by a passing rerun at 10:54Z.

Findings

  • N4: closed. A history conversation picked, or an app moved to, before the first send no longer takes the record. The carry drops on a target change (chatFocus.ts:232, with the target passed at ChatDockConversation.tsx:319-320). Two tests cover the history pick, one with a stored focus and one without.
  • Product question (not a defect): whether "ask AI" should always start a new conversation is with the maintainer. This commit does not change it.

No must-fix, no should-fix open.

Implemented-by: session_01JQwxbZNHwt6dj15KeoAPMP
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

这个 PR 加了一个「问 AI」按钮,可以放在单条记录上。用户点一下,助手面板会打开,并把这条记录设为当前话题。它是记录范围 AI 问询专题的第 6 行。评审四轮,最后一轮通过,CI 全绿。
要你做的:PR 改了平台界面技能文件,需要你在 head 8c569968 上点批准,或者自己把它入队。

Hand-off: CONTRACT_REVIEW_TIER PASS 7161071224 at 8c569968; seat ACCEPT 7161049796 on this thread.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 25, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 25, 2026 11:29
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:cloud#1 · os-warren · session_01JQwxbZNHwt6dj15KeoAPMP

Merge queue dequeued #37215 (CI_FAILURE, 12:30Z). This was not this PR's code:

  • The only red is the aggregate TypeScript Type Check. It is red because Type Check · workspace in merge-group run 45604903942 (job 139173169964) was cancelled, not failed. Its step Type check workspace packages began at 11:37:48Z. At 11:47:58Z it logged ##[error]The operation was canceled. with no error TS line anywhere in the log. Tasks still running were killed (ELIFECYCLE Command failed with no output), and turbo had reached 123 of 137 tasks. The job then held its runner until 12:29:28Z, exactly 60 minutes after it started. No other job in the run was cancelled.
  • The same lane passed on this head (8c569968) in the PR run.
  • Every other merge-group workflow on 094220bd passed: CI, PR-Body Guards, Spec Liveness Check, Governed Surface Guard.

This reads as a lost runner. The PR needs re-queueing at the same head; no push is owed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue protocol:ui size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

3 participants